package com.lemon.smartsafetynew.ui.fragment.base;

import android.support.v4.widget.SwipeRefreshLayout;

import com.lemon.smartsafety.R;

/**
 * Created by SlienceDut on 2015/12/12.
 */
public abstract class ToolbarSwipeRefreshFragment extends ToolbarBaseFragment implements SwipeRefreshLayout.OnRefreshListener {
    protected SwipeRefreshLayout mSwipeRefreshLayout;

    protected boolean isRefreshing() {
        return mSwipeRefreshLayout.isRefreshing();
    }

    protected void stopRefreshing() {
        mSwipeRefreshLayout.setRefreshing(false);
    }

    @Override
    protected void initViews() {
        super.initViews();
        mSwipeRefreshLayout = getViewById(R.id.swipeRefreshLayout);
        if (mSwipeRefreshLayout != null) {
            mSwipeRefreshLayout.setOnRefreshListener(this);
            mSwipeRefreshLayout.setColorSchemeResources(R.color.colorPrimary, R.color.colorPrimaryLight);
        }
    }



}
